/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

/**
 *
 * @author Jerry
 */
public class Inverse extends Adjunct{
    
    public double [][] calculateInverse(int [][] matrix){
        
        Adjunct adjunctMatrix = new Adjunct();
        Determinant determinantOfMatrix = new Determinant();
        SkalarMultiplikation skalarMatrix = new SkalarMultiplikation();
        
        int n = matrix.length;
        
      double inverseMatrix[][];
      double determinant = (1/determinantOfMatrix.determinantOfMatrix(matrix));
      
      inverseMatrix = skalarMatrix.calculateSkalarMultiplikation(determinant, adjunctMatrix.calculateAdjunct(matrix));
      
        return inverseMatrix;
}
}
